<?php
// parse xml elements as array 

$xml = simplexml_load_file("books.xml");		// load 

foreach ($xml->book[2]->children() as $childName => $value) {
	echo "$childName : $value \n";
}